package vietnam.traveltools.view;

import vietnam.traveltools.TaxiActivity;
import vietnam.traveltools.R;
import vietnam.traveltools.variables.ListItem;
import android.app.Service;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TaxiView extends LinearLayout {
	public TextView tvName;
	public TextView tvPhone;
	public TextView tvCity;
	public TextView tvPrice_Open;
	public TextView tvPrice_1;
	public TextView tvPrice_2;
	public LinearLayout lnTaxi;

	public TaxiView(Context context) {
		super(context);

		LayoutInflater linflater = (LayoutInflater) ((TaxiActivity) context)
				.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
		linflater.inflate(R.layout.item_taxi_layout, this);

		this.tvName = (TextView) findViewById(R.id.tvName);
		this.tvPhone = (TextView) findViewById(R.id.tvPhone);
		this.tvPrice_Open = (TextView) findViewById(R.id.tvPrice_Open);
		this.tvPrice_1 = (TextView) findViewById(R.id.tvPrice_1);
		this.tvPrice_2 = (TextView) findViewById(R.id.tvPrice_2);
		this.tvCity = (TextView) findViewById(R.id.tvCity);
		this.lnTaxi = (LinearLayout) findViewById(R.id.lnTaxi);
	}

	public void setListItem(ListItem item) {
		this.tvPhone.setText(item._phone);
		this.tvPrice_Open.setText(item._price_open);
		this.tvPrice_1.setText(item._price_1);
		this.tvPrice_2.setText(item._price_2);
		this.tvCity.setText(item._city);
		this.tvName.setText(item._name);
	}

}
